a few exif cleanups.
authortsteven4 <tsteven4@gmail.com>
Sat, 25 Aug 2018 21:17:03 +0000 (15:17 -0600)
committertsteven4 <tsteven4@gmail.com>
Sat, 25 Aug 2018 21:17:03 +0000 (15:17 -0600)
exif.cc

diff --git a/exif.cc b/exif.cc
index d74c037a27c9264b5cb83a7e786e9cb7bc641740..639e4147c9ff8f38d39816a2734a8c4c4d4f947c 100644 (file)
--- a/exif.cc
+++ b/exif.cc
 #include <QtCore/QtGlobal>         // for qPrintable
 #include <algorithm>               // for sort, min
 #include <cassert>                 // for assert
+#include <cctype>                  // for isprint, isspace
 #include <cfloat>                  // for DBL_EPSILON
 #include <cmath>                   // for fabs, modf, copysign, round, fmax
 #include <cstdint>                 // for int32_t, int16_t, uint16_t, uint32_t, uint8_t, INT32_MAX
 #include <cstdio>                  // for printf, snprintf, SEEK_SET, SEEK_CUR
 #include <cstdlib>                 // for labs, atoi
 #include <cstring>                 // for strrchr, memcmp, strchr, strlen
-#include <ctype.h>                 // for isprint, isspace
 
 #define MYNAME "exif"
 
@@ -1459,9 +1459,9 @@ exif_write_apps()
       gbfputuint32(0, ftmp); /* DWORD(0) after last ifd */
 
       // relocate thumbnail image data.
-      for (int idx = 0; idx < image_data.size(); ++idx) {
-        gbfseek(app->fexif, image_data.at(idx).first, SEEK_SET);
-        gbfcopyfrom(ftmp, app->fexif, image_data.at(idx).second);
+      for (const auto& segment : image_data) {
+        gbfseek(app->fexif, segment.first, SEEK_SET);
+        gbfcopyfrom(ftmp, app->fexif, segment.second);
       }
 
       len = gbftell(ftmp);